/**
 * com.chaeron.GPS - An API for access to GPS devices.
 *
 *
 * Copyright (c) 2001, 2002 Chaeron Corporation,
 * All rights reserved.
 * 
 * Chaeron grants you a non-exclusive license to use, modify and re-distribute
 * this program under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version, provided that this copyright notice and 
 * license appear on all copies of the software.
 * 
 * Software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR
 * IMPLIED REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE
 * HEREBY EXCLUDED. THE ENTIRE RISK ARISING OUT OF USING THE SOFTWARE IS ASSUMED
 * BY THE LICENSEE. See the GNU General Public License for more details.
 *
 * CHAERON AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY
 * LICENSEE OR ANY THIRD PARTY AS A RESULT OF USING OR DISTRIBUTING SOFTWARE.
 * IN NO EVENT WILL CHAERON OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE,
 * PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL
 * OR PUNITIVE DAMAGES, HOWEVER CAUSED AN REGARDLESS OF THE THEORY OF LIABILITY,
 * ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF CHAERON HAS
 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

 * @version     1.02
 * @author      Andrzej Jan Taramina, Chaeron Corporation
 *              andrzej@chaeron.com
 */

package com.chaeron.GPS;

//***************************************************************************
//*
//*     Imports
//*
//***************************************************************************/

//***************************************************************************
//*
//*     Compile interface definition
//*
//***************************************************************************/

/**
 * <p>The Compile interface defines compile time flags.  These constants can be used
 * to not include specific functionality such as supported Protocols, specific NMEA sentences
 * or Garmin functions.  By not including functionality that you do not need, the memory footprint
 * of the executable can be reduced substantially.  If you are using an intelligent Java compiler
 * it should automatically eliminate classes that are not needed from your executable.  Otherwise, you'll 
 * have to prune the class tree manually (and carefully too!).</p>
 *
 * <p> For sub-flags that depend on semantically higher level flags, an idiom is used where the flag is 
 * &&'ed with the parent flag.  This ensures that if you turn off a higher level flag (say for a complete
 * protocol) that all subflags will also be turned off automatically.  This is done to eliminate unecessary
 * bytecodes where possible for situations where automatic class/method pruning is not used. 
 */

public interface Compile
{
	
	//***************************************************************************
	//*
	//*     Debugging Flags
	//*
	//***************************************************************************/
	
	public final static boolean	DEBUG								= false;
	public final static boolean	DEBUG_SERIALPORT					= false;
	public final static boolean	DEBUG_DUMPSERIALBUFFER				= false;
	
	
	//***************************************************************************
	//*
	//*     Packet/Event Queuing Settings
	//*
	//***************************************************************************/

	// Packet Queue size settings:
	//
	// 0 	=> No Queuing
	// > 0 	=> Maximum Queue size (LRU will be discarded if we hit max)
	// < 0	=> Infinite Queue size, value denotes starting size of queue
	
	public final static int	PACKET_QUEUE_SIZE						= 20;
	
	// Event Queue size settings:
	//
	// 0 	=> Infinite queue size, uses default starting size of queue
	// > 0 	=> Maximum Queue size (LRU will be discarded if we hit max)
	// < 0	=> Infinite Queue size, value denotes starting size of queue
	
	public final static int	EVENT_QUEUE_SIZE						= 20;
	
	// These settings are used to control how much work is done during each gps.poll() invocation.  For PC's typically
	// infinite values work just fine.  For event-driven OS's such as PalmOS, you may need to adjust these values in conjunction
	// with how often the gps.poll() function is called, to balance the processing load so that other OS functions still get serviced
	// often enough (eg. Bluetooth SPP connections seem to need regular cpu cycles, so doing too much processing in a gps.poll()
	// invocation can cause the Bluetooth SPP connection to drop with a Line Error: Carrier Lost error.).  Typically if you put a 
	// limit on the number of packets/events processed each poll, then the queue size should be limited in size as well to avoid
	// infinite growth of the queue.
	
	public final static int	MAX_PACKETS_PROCESSED_PER_POLL			= 0;	// if <= 0, process all queued packets
	public final static int	MAX_EVENTS_PROPAGATED_PER_POLL			= 5;	// if <= 0, propagate all queued GPS events
	
	
	//***************************************************************************
	//*
	//*     Event Decorator Inclusion Flags
	//*
	//***************************************************************************/
	
	public final static boolean	INCLUDE_EVENT_DECORATORS			= true;
	
	public final static boolean INCLUDE_EVENT_TOXML					= true && INCLUDE_EVENT_DECORATORS;
	public final static boolean INCLUDE_EVENT_SAVETOCATALOG			= true && INCLUDE_EVENT_DECORATORS;
	
	
	//***************************************************************************
	//*
	//*     Protocol Inclusion Flags
	//*
	//***************************************************************************/
	
	public final static boolean	INCLUDE_PROTOCOL_NMEA				= true;
	public final static boolean	INCLUDE_PROTOCOL_GARMIN				= true;
	
	
	//***************************************************************************
	//*
	//*    NMEA Inclusion Flags
	//*
	//***************************************************************************/
	
	// NMEA Sentence Inclusion Flags
	
	public final static boolean	INCLUDE_NMEA_SENTENCE_BOD			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_GGA			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_GLL			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_GSA			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_GSV			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_HDG			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_RMB			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_RMC			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_RTE			= true && INCLUDE_PROTOCOL_NMEA;
	
	// NMEA Sentence Inclusion Flags - Garmin Specific
	
	public final static boolean	INCLUDE_NMEA_SENTENCE_PGRME			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_PGRMZ			= true && INCLUDE_PROTOCOL_NMEA;
	public final static boolean	INCLUDE_NMEA_SENTENCE_PGRMM			= true && INCLUDE_PROTOCOL_NMEA;
	
	
	//***************************************************************************
	//*
	//*    Garmin Inclusion Flags
	//*
	//***************************************************************************/
	
	public final static boolean	INCLUDE_GARMIN_PACKET_PVT			= true && INCLUDE_PROTOCOL_GARMIN;
	public final static boolean	INCLUDE_GARMIN_DOWNLOAD_WAYPOINTS	= true && INCLUDE_PROTOCOL_GARMIN;
	public final static boolean	INCLUDE_GARMIN_DOWNLOAD_ROUTES		= true && INCLUDE_PROTOCOL_GARMIN;
	public final static boolean	INCLUDE_GARMIN_DOWNLOAD_TRACKLOGS	= true && INCLUDE_PROTOCOL_GARMIN;
	
}
